//server.h
#ifndef SERVER_H
#define SERVER_H

#include "serversynch.h"
#include "network.h"
#include "post.h"
#include "serverglobals.cc"

class ServerLock;
class ServerCondition;

class Server {
  public:
    Server();
    ~Server();
    
    void ReceiveMessage(int type, int from, int lock, int cond, int ind, int val);
	void AddToReadyQueue(int to);
	int GetNextPktDest();
	int GetMV(int index);

  private:
	ServerLock* serverDataLock;
	ServerLock* serverLock[MAX_NUM_SERVLOCKS];
	ServerCondition* serverCond[MAX_NUM_SERVCONDS];
	int serverLockIndex;
	List* readyPktQueue;
	List* readyMailQueue;
	int* monVar;
};
#endif
